{% extends "howto" %}

{% block main %}
<h2 id="using-tools">Using Tools</h2>

<p><em>Tools</em> are a way to add generic functionalities to Kits. They are named instances loading their configuration from the kit they belong to.</p>

<p>They are retrieved as Kit instance members :</p>

<code>// getting the "example" kit instance
<var>$kit</var>=&amp;webappkit::getKit('example');

// calling method "connect" of the kit's tool member "dblink"
<var>$kit</var>->dblink->connect();</code>

<p>Here the <q>example</q> kit provide a service which it does not implement itself through its <q>dblink</q> member tool. Only the service configuration data is taken from the kit, source code is provided by another kit listed as a dependancy.</p>

<h3>How it works</h3>
<p>Kit's metadata file lists Tools. Keys are Tool names and value their class :</p>
<code>[tools]
<var>name</var> = "class"</code>

<p>Kit may then provide a configuration file for the Tool which have to be named <var>name</var>.tool.ini</p>
{% endblock %}
